package com.baikeyang.controller;

import com.baikeyang.commons.Constants;
import com.baikeyang.commons.bean.ResponseResult;
import com.baikeyang.service.role.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by lenovo on 2018/9/13.
 */
@RestController
@RequestMapping("")
public class DemoController {

    private IRoleService roleService;

    @Autowired
    public void setRoleService(IRoleService roleService) {
        this.roleService = roleService;
    }

    @RequestMapping(value = "index")
    public ResponseResult index () {
        return roleService.getAllRoles();
        //return new ResponseResult(Constants.EXECUTEINFO.失败, Constants.EXECUTECODE.CODE_500);
    }

}
